3.121 \(\int \frac{\cos ^4(c+d x)}{(a+i a \tan (c+d x))^2} \, dx\)

Optimal. Leaf size=165 \[ \frac{i a^2}{32 d (a+i a \tan (c+d x))^4}-\frac{5 i}{64 d \left (a^2-i a^2 \tan (c+d x)\right )}+\frac{5 i}{32 d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac{15 x}{64 a^2}+\frac{i a}{16 d (a+i a \tan (c+d x))^3}-\frac{i}{64 d (a-i a \tan (c+d x))^2}+\frac{3 i}{32 d (a+i a \tan (c+d x))^2} \]

[Out]

(15*x)/(64*a^2) - (I/64)/(d*(a - I*a*Tan[c + d*x])^2) + ((I/32)*a^2)/(d*(a + I*a*Tan[c + d*x])^4) + ((I/16)*a)
/(d*(a + I*a*Tan[c + d*x])^3) + ((3*I)/32)/(d*(a + I*a*Tan[c + d*x])^2) - ((5*I)/64)/(d*(a^2 - I*a^2*Tan[c + d
*x])) + ((5*I)/32)/(d*(a^2 + I*a^2*Tan[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.103233, antiderivative size = 165, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125, Rules used = {3487, 44, 206} \[ \frac{i a^2}{32 d (a+i a \tan (c+d x))^4}-\frac{5 i}{64 d \left (a^2-i a^2 \tan (c+d x)\right )}+\frac{5 i}{32 d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac{15 x}{64 a^2}+\frac{i a}{16 d (a+i a \tan (c+d x))^3}-\frac{i}{64 d (a-i a \tan (c+d x))^2}+\frac{3 i}{32 d (a+i a \tan (c+d x))^2} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^4/(a + I*a*Tan[c + d*x])^2,x]

[Out]

(15*x)/(64*a^2) - (I/64)/(d*(a - I*a*Tan[c + d*x])^2) + ((I/32)*a^2)/(d*(a + I*a*Tan[c + d*x])^4) + ((I/16)*a)
/(d*(a + I*a*Tan[c + d*x])^3) + ((3*I)/32)/(d*(a + I*a*Tan[c + d*x])^2) - ((5*I)/64)/(d*(a^2 - I*a^2*Tan[c + d
*x])) + ((5*I)/32)/(d*(a^2 + I*a^2*Tan[c + d*x]))

Rule 3487

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{\cos ^4(c+d x)}{(a+i a \tan (c+d x))^2} \, dx &=-\frac{\left (i a^5\right ) \operatorname{Subst}\left (\int \frac{1}{(a-x)^3 (a+x)^5} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac{\left (i a^5\right ) \operatorname{Subst}\left (\int \left (\frac{1}{32 a^5 (a-x)^3}+\frac{5}{64 a^6 (a-x)^2}+\frac{1}{8 a^3 (a+x)^5}+\frac{3}{16 a^4 (a+x)^4}+\frac{3}{16 a^5 (a+x)^3}+\frac{5}{32 a^6 (a+x)^2}+\frac{15}{64 a^6 \left (a^2-x^2\right )}\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac{i}{64 d (a-i a \tan (c+d x))^2}+\frac{i a^2}{32 d (a+i a \tan (c+d x))^4}+\frac{i a}{16 d (a+i a \tan (c+d x))^3}+\frac{3 i}{32 d (a+i a \tan (c+d x))^2}-\frac{5 i}{64 d \left (a^2-i a^2 \tan (c+d x)\right )}+\frac{5 i}{32 d \left (a^2+i a^2 \tan (c+d x)\right )}-\frac{(15 i) \operatorname{Subst}\left (\int \frac{1}{a^2-x^2} \, dx,x,i a \tan (c+d x)\right )}{64 a d}\\ &=\frac{15 x}{64 a^2}-\frac{i}{64 d (a-i a \tan (c+d x))^2}+\frac{i a^2}{32 d (a+i a \tan (c+d x))^4}+\frac{i a}{16 d (a+i a \tan (c+d x))^3}+\frac{3 i}{32 d (a+i a \tan (c+d x))^2}-\frac{5 i}{64 d \left (a^2-i a^2 \tan (c+d x)\right )}+\frac{5 i}{32 d \left (a^2+i a^2 \tan (c+d x)\right )}\\ \end{align*}

Mathematica [A]  time = 0.252469, size = 120, normalized size = 0.73 \[ \frac{i \sec ^2(c+d x) (-120 d x \sin (2 (c+d x))+30 i \sin (2 (c+d x))+32 i \sin (4 (c+d x))+3 i \sin (6 (c+d x))+30 i (4 d x+i) \cos (2 (c+d x))+16 \cos (4 (c+d x))+\cos (6 (c+d x))-80)}{512 a^2 d (\tan (c+d x)-i)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^4/(a + I*a*Tan[c + d*x])^2,x]

[Out]

((I/512)*Sec[c + d*x]^2*(-80 + (30*I)*(I + 4*d*x)*Cos[2*(c + d*x)] + 16*Cos[4*(c + d*x)] + Cos[6*(c + d*x)] +
(30*I)*Sin[2*(c + d*x)] - 120*d*x*Sin[2*(c + d*x)] + (32*I)*Sin[4*(c + d*x)] + (3*I)*Sin[6*(c + d*x)]))/(a^2*d
*(-I + Tan[c + d*x])^2)

________________________________________________________________________________________

Maple [A]  time = 0.094, size = 157, normalized size = 1. \begin{align*}{\frac{-{\frac{15\,i}{128}}\ln \left ( \tan \left ( dx+c \right ) -i \right ) }{{a}^{2}d}}+{\frac{{\frac{i}{32}}}{{a}^{2}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{4}}}-{\frac{{\frac{3\,i}{32}}}{{a}^{2}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{2}}}-{\frac{1}{16\,{a}^{2}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{3}}}+{\frac{5}{32\,{a}^{2}d \left ( \tan \left ( dx+c \right ) -i \right ) }}+{\frac{{\frac{i}{64}}}{{a}^{2}d \left ( \tan \left ( dx+c \right ) +i \right ) ^{2}}}+{\frac{{\frac{15\,i}{128}}\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{{a}^{2}d}}+{\frac{5}{64\,{a}^{2}d \left ( \tan \left ( dx+c \right ) +i \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^4/(a+I*a*tan(d*x+c))^2,x)

[Out]

-15/128*I/a^2/d*ln(tan(d*x+c)-I)+1/32*I/a^2/d/(tan(d*x+c)-I)^4-3/32*I/a^2/d/(tan(d*x+c)-I)^2-1/16/a^2/d/(tan(d
*x+c)-I)^3+5/32/a^2/d/(tan(d*x+c)-I)+1/64*I/a^2/d/(tan(d*x+c)+I)^2+15/128*I/a^2/d*ln(tan(d*x+c)+I)+5/64/a^2/d/
(tan(d*x+c)+I)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4/(a+I*a*tan(d*x+c))^2,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 2.29797, size = 279, normalized size = 1.69 \begin{align*} \frac{{\left (120 \, d x e^{\left (8 i \, d x + 8 i \, c\right )} - 2 i \, e^{\left (12 i \, d x + 12 i \, c\right )} - 24 i \, e^{\left (10 i \, d x + 10 i \, c\right )} + 80 i \, e^{\left (6 i \, d x + 6 i \, c\right )} + 30 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 8 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i\right )} e^{\left (-8 i \, d x - 8 i \, c\right )}}{512 \, a^{2} d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4/(a+I*a*tan(d*x+c))^2,x, algorithm="fricas")

[Out]

1/512*(120*d*x*e^(8*I*d*x + 8*I*c) - 2*I*e^(12*I*d*x + 12*I*c) - 24*I*e^(10*I*d*x + 10*I*c) + 80*I*e^(6*I*d*x
+ 6*I*c) + 30*I*e^(4*I*d*x + 4*I*c) + 8*I*e^(2*I*d*x + 2*I*c) + I)*e^(-8*I*d*x - 8*I*c)/(a^2*d)

________________________________________________________________________________________

Sympy [A]  time = 1.17119, size = 260, normalized size = 1.58 \begin{align*} \begin{cases} \frac{\left (- 17179869184 i a^{10} d^{5} e^{24 i c} e^{4 i d x} - 206158430208 i a^{10} d^{5} e^{22 i c} e^{2 i d x} + 687194767360 i a^{10} d^{5} e^{18 i c} e^{- 2 i d x} + 257698037760 i a^{10} d^{5} e^{16 i c} e^{- 4 i d x} + 68719476736 i a^{10} d^{5} e^{14 i c} e^{- 6 i d x} + 8589934592 i a^{10} d^{5} e^{12 i c} e^{- 8 i d x}\right ) e^{- 20 i c}}{4398046511104 a^{12} d^{6}} & \text{for}\: 4398046511104 a^{12} d^{6} e^{20 i c} \neq 0 \\x \left (\frac{\left (e^{12 i c} + 6 e^{10 i c} + 15 e^{8 i c} + 20 e^{6 i c} + 15 e^{4 i c} + 6 e^{2 i c} + 1\right ) e^{- 8 i c}}{64 a^{2}} - \frac{15}{64 a^{2}}\right ) & \text{otherwise} \end{cases} + \frac{15 x}{64 a^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**4/(a+I*a*tan(d*x+c))**2,x)

[Out]

Piecewise(((-17179869184*I*a**10*d**5*exp(24*I*c)*exp(4*I*d*x) - 206158430208*I*a**10*d**5*exp(22*I*c)*exp(2*I
*d*x) + 687194767360*I*a**10*d**5*exp(18*I*c)*exp(-2*I*d*x) + 257698037760*I*a**10*d**5*exp(16*I*c)*exp(-4*I*d
*x) + 68719476736*I*a**10*d**5*exp(14*I*c)*exp(-6*I*d*x) + 8589934592*I*a**10*d**5*exp(12*I*c)*exp(-8*I*d*x))*
exp(-20*I*c)/(4398046511104*a**12*d**6), Ne(4398046511104*a**12*d**6*exp(20*I*c), 0)), (x*((exp(12*I*c) + 6*ex
p(10*I*c) + 15*exp(8*I*c) + 20*exp(6*I*c) + 15*exp(4*I*c) + 6*exp(2*I*c) + 1)*exp(-8*I*c)/(64*a**2) - 15/(64*a
**2)), True)) + 15*x/(64*a**2)

________________________________________________________________________________________

Giac [A]  time = 1.14435, size = 171, normalized size = 1.04 \begin{align*} -\frac{\frac{60 i \, \log \left (i \, \tan \left (d x + c\right ) + 1\right )}{a^{2}} - \frac{60 i \, \log \left (i \, \tan \left (d x + c\right ) - 1\right )}{a^{2}} + \frac{2 \,{\left (45 i \, \tan \left (d x + c\right )^{2} - 110 \, \tan \left (d x + c\right ) - 69 i\right )}}{a^{2}{\left (\tan \left (d x + c\right ) + i\right )}^{2}} + \frac{-125 i \, \tan \left (d x + c\right )^{4} - 580 \, \tan \left (d x + c\right )^{3} + 1038 i \, \tan \left (d x + c\right )^{2} + 868 \, \tan \left (d x + c\right ) - 301 i}{a^{2}{\left (\tan \left (d x + c\right ) - i\right )}^{4}}}{512 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4/(a+I*a*tan(d*x+c))^2,x, algorithm="giac")

[Out]

-1/512*(60*I*log(I*tan(d*x + c) + 1)/a^2 - 60*I*log(I*tan(d*x + c) - 1)/a^2 + 2*(45*I*tan(d*x + c)^2 - 110*tan
(d*x + c) - 69*I)/(a^2*(tan(d*x + c) + I)^2) + (-125*I*tan(d*x + c)^4 - 580*tan(d*x + c)^3 + 1038*I*tan(d*x +
c)^2 + 868*tan(d*x + c) - 301*I)/(a^2*(tan(d*x + c) - I)^4))/d